<?php
Route::get('/', function () {
    return redirect()->to('admin');
});

Route::group(['prefix' => 'admin', 'namespace' => 'Admin'], function () {
    Route::get('/', 'WelcomeController@getIndex');
    Route::get('register', 'AccountController@register');
    Route::get('forget', 'AccountController@forget');
    Route::get('logout', 'AccountController@logout');

    Route::get('profile', 'ProfileController@getIndex');
    Route::get('profile/changepwd', 'ProfileController@getChangepwd');
    Route::post('user/set-profile', 'ProfileController@postSetProfile');
    Route::post('user/changepwd', 'ProfileController@postChangepwd');
    Route::post('user/upload-avatar/{id}', 'ProfileController@postUploadAvatar');

    Route::post('account/login', 'AccountController@postLogin');
    Route::post('account/register', 'AccountController@postRegister');
    Route::post('account/send-sms-code', 'AccountController@sendSmsCode');
    Route::post('account/send-mail-code', 'AccountController@sendMailCode');
    Route::post('account/check-username-unique', 'AccountController@checkUsernameUnique');
    Route::post('account/check-mobile-unique', 'AccountController@checkMobileUnique');
    Route::post('account/check-email-unique', 'AccountController@checkEmailUnique');
    Route::post('account/forget', 'AccountController@postForget');
    Route::post('account/findpwd', 'AccountController@postFindpwd');


    Route::group(['prefix' => 'siteconfig'], function () {
        Route::get('/', 'SiteconfigController@index');
        Route::post('/setting-config', 'SiteconfigController@postSettingConfig');

        // Route::get('meta', 'SiteconfigController@getMeta');
        // Route::post('set-meta', 'SiteconfigController@postSetMeta');
        // Route::get('logo', 'SiteconfigController@getLogo');
        // Route::post('upload-logo', 'SiteconfigController@postUploadLogo');
    });
    Route::get('entrust/role-list', 'EntrustController@getRoleList');
    Route::get('entrust/perm-list', 'EntrustController@getPermList');
    Route::get('entrust/user-list', 'EntrustController@getUserList');
    Route::get('entrust/user-add', 'EntrustController@getUserAdd');
    Route::get('entrust/user-edit', 'EntrustController@getUserEdit');
    Route::get('entrust/role-add', 'EntrustController@getRoleAdd');
    Route::get('entrust/role-edit', 'EntrustController@getRoleEdit');
    Route::get('entrust/perm-add', 'EntrustController@getPermAdd');
    Route::get('entrust/perm-edit/{id}', 'EntrustController@getPermEdit');
    Route::get('entrust/role-perms-list/{id}', 'EntrustController@getRolePermsList');
    Route::get('entrust/perm-role-list/{id}', 'EntrustController@getPermRoleList');
    Route::get('entrust/role-users-list/{id}', 'EntrustController@getRoleUsersList');

    Route::get('newsclass', 'NewsclassController@getIndex');
    Route::get('newsclass/tree-list', 'NewsclassController@getTreeList');
    Route::get('newsclass/popedom', 'NewsclassController@getPopedom');
    Route::get('newsinfo', 'NewsinfoController@getIndex');
    Route::get('newsinfo/list/{class_id}', 'NewsinfoController@getList');
    Route::get('newsinfo/pics', 'NewsinfoController@getPics');

    Route::get('department/ztree-rows', 'DepartmentController@getZtreeRows');
    Route::get('department/user-rows', 'DepartmentController@getUserRows');
    Route::post('department/create', 'DepartmentController@postCreate');
    Route::post('department/rename', 'DepartmentController@postRename');
    Route::post('department/delete', 'DepartmentController@postDelete');

    Route::get('message/new-msg-count', 'MessageController@getNewMsgCount');
    Route::get('message/inbox', 'MessageController@getInbox');
    Route::get('message/drafts', 'MessageController@getDrafts');
    Route::get('message/outbox', 'MessageController@getOutbox');
    Route::get('message/trash', 'MessageController@getTrash');
    Route::get('message/details', 'MessageController@getDetails');
    Route::get('message/write', 'MessageController@getWrite');
    Route::get('message/edit', 'MessageController@getEdit');
    Route::get('message/download-file1', 'MessageController@getDownloadFile1');
    Route::post('message/save-drafts', 'MessageController@postSaveDrafts');
    Route::post('message/delete-file1', 'MessageController@postDeleteFile1');
    Route::post('message/send', 'MessageController@postSend');
    Route::post('message/inbox-to-trash', 'MessageController@postInboxToTrash');
    Route::post('message/outbox-to-trash', 'MessageController@postOutboxToTrash');
    Route::post('message/delete-drafts', 'MessageController@postDeleteDrafts');
    Route::post('message/delete', 'MessageController@postDelete');

    Route::get('userfiles', 'UserfilesController@getIndex');
    Route::get('userfiles/page-rows', 'UserfilesController@getPageRows');
    Route::post('userfiles/add-folder', 'UserfilesController@postAddFolder');
    Route::post('userfiles/ren-folder', 'UserfilesController@postRenFolder');
    Route::post('userfiles/remove-folder', 'UserfilesController@postRemoveFolder');
    Route::get('userfiles/folder-ztree', 'UserfilesController@getFolderZtree');
    Route::post('userfiles/change-sort-by-ztree', 'UserfilesController@postChangeSortByZtree');
    Route::post('userfiles/upload-file', 'UserfilesController@postUploadFile');
    Route::get('userfiles/download-file', 'UserfilesController@getDownloadFile');
    Route::get('userfiles/file-info', 'UserfilesController@getFileInfo');
    Route::post('userfiles/ren-file', 'UserfilesController@postRenFile');
    Route::post('userfiles/move-files', 'UserfilesController@postMoveFiles');
    Route::post('userfiles/remove-files', 'UserfilesController@postRemoveFiles');

    Route::get('link', 'LinkController@getIndex');
    Route::get('link/add', 'LinkController@getAdd');
    Route::get('link/edit/{id}', 'LinkController@getEdit');
    Route::get('link/tag-list', 'LinkController@getTagList');
    Route::post('link/insert', 'LinkController@postInsert');
    Route::post('link/update', 'LinkController@postUpdate');
    Route::post('link/upload-pic1', 'LinkController@postUploadPic1');
    Route::post('link/delete-pic1', 'LinkController@postDeletePic1');
    Route::post('link/delete', 'LinkController@postDelete');
    Route::post('link/add-tag', 'LinkController@postAddTag');
    Route::post('link/edit-tag', 'LinkController@postEditTag');
    Route::post('link/del-tag', 'LinkController@postDelTag');

    Route::get('pageadver', 'PageadverController@getIndex');
    Route::get('pageadver/add', 'PageadverController@getAdd');
    Route::get('pageadver/edit', 'PageadverController@getEdit');
    Route::get('pageadver/page-rows', 'PageadverController@getPageRows');
    Route::post('pageadver/insert', 'PageadverController@postInsert');
    Route::post('pageadver/update', 'PageadverController@postUpdate');
    Route::post('pageadver/upload-pic1', 'PageadverController@postUploadPic1');
    Route::post('pageadver/delete', 'PageadverController@postDelete');

    Route::get('mkapp', 'MkappController@getIndex');
    Route::get('mkapp/all-rows', 'MkappController@getAllRows');
    Route::get('mkapp/app-info', 'MkappController@getAppInfo');
    Route::post('mkapp/upload-pic1', 'MkappController@postUploadPic1');
    Route::post('mkapp/upload-file1', 'MkappController@postUploadFile1');
    Route::post('mkapp/insert', 'MkappController@postInsert');
    Route::post('mkapp/update', 'MkappController@postUpdate');
    Route::get('mkapp/all-releases', 'MkappController@getAllReleases');
    Route::get('mkapp/release-info', 'MkappController@getReleaseInfo');
    Route::post('mkapp/add-release', 'MkappController@postAddRelease');
    Route::post('mkapp/edit-release', 'MkappController@postEditRelease');
    Route::post('mkapp/remove-release', 'MkappController@postRemoveRelease');
    Route::post('mkapp/delete', 'MkappController@postDelete');

    Route::get('exam/topic', 'ExamController@getTopic');
    Route::get('exam/page-rows', 'ExamController@getPageRows');
    Route::get('exam/add-topic', 'ExamController@getAddTopic');
    Route::get('exam/edit', 'ExamController@getEdit');
    Route::post('exam/insert', 'ExamController@postInsert');
    Route::post('exam/update', 'ExamController@postUpdate');
    Route::post('exam/delete', 'ExamController@postDelete');

    Route::get('team/designer-list', 'TeamController@getDesignerList');
    Route::get('team/designer-rows', 'TeamController@getDesignerRows');
    Route::get('team/designer-page-rows', 'TeamController@getDesignerPageRows');
    Route::get('team/designer-add', 'TeamController@getDesignerAdd');
    Route::post('team/designer-insert', 'TeamController@postDesignerInsert');
    Route::get('team/designer-edit', 'TeamController@getDesignerEdit');
    Route::post('team/designer-update', 'TeamController@postDesignerUpdate');
    Route::post('team/upload-headimg', 'TeamController@postUploadHeadimg');
    Route::post('team/remove-headimg', 'TeamController@postRemoveHeadimg');
    Route::post('team/designer-delete', 'TeamController@postDesignerDelete');

    # 用户
    Route::get('user', 'UserController@index');//
    Route::get('user/vip', 'UserController@vip');//
    Route::get('user/info/{id}', 'UserController@getUserInfo')->where('id', '[0-9]+');
    Route::post('user/info/update', 'UserController@update');

    Route::get('order', 'OrderController@index');//
    Route::get('order/export', 'OrderController@export');//



    Route::group(['prefix' => 'box'], function () {
        Route::get('/', 'BoxController@index');//
        Route::get('{id}', 'BoxController@getBoxInfo')->where('id', '[0-9]+');//
        Route::post('send', 'BoxController@postSend');//
        Route::post('collocation', 'BoxController@postCollocation');//
        Route::get('collocation-page-row/{id}', 'BoxController@getCollocationPageRows')->where('id', '[0-9]+');
        Route::post('collocation/del', 'BoxController@postdeleteCollocation')->where('id', '[0-9]+');
        Route::get('collocation/info', 'BoxController@postCollocationInfo')->where('id', '[0-9]+');
        Route::post('change', 'BoxController@postChange');
        Route::get('{id}/comment', 'BoxController@comment');
        
        //关怀盒子
        Route::get('care', 'BoxCareController@getBoxCare');
        Route::get('care/page-rows', 'BoxCareController@getBoxCarePageRows');//
        Route::post('care/send', 'BoxCareController@postCareSend');//
        Route::post('care/change', 'BoxCareController@postCareChange');
        Route::post('care/address', 'BoxCareController@postCareAddress');

        //赠送盒子
        Route::get('give', 'BoxController@getBoxGive');
        Route::get('give/page-rows', 'BoxController@getBoxGivePageRows');//

        Route::get('send-address', 'BoxController@getSendAddress');//查询盒子收货地址
    });

    Route::group(['prefix' => 'goods'], function () {
        Route::get('change', 'BoxChangeController@change');
        Route::get('page-rows', 'BoxChangeController@getPageRows');
        Route::post('change', 'BoxChangeController@postChange');
        Route::get('{id}', 'BoxChangeController@getInfo')->where('id', '[0-9]+');;
        Route::get('collect-send/{id}', 'BoxChangeController@getCollectSend');
        Route::post('send', 'BoxChangeController@postSend');
        Route::get('{id}/photos', 'BoxChangeController@getPhotos')->where('id', '[0-9]+');
    });

    Route::group(['prefix' => 'stylist'], function () {
        Route::get('/', 'StylistController@index');//
        Route::post('create', 'StylistController@postCreate');//
        Route::get('info', 'StylistController@getInfo');//
        Route::post('del', 'StylistController@postDelete');//
        Route::post('edit', 'StylistController@postEdit');
    });


    Route::group(['prefix' => 'activity'], function () {
        Route::get('/', 'ActivityController@index');
        Route::get('page-rows', 'ActivityController@getPageRows');
        Route::get('{id}/export', 'ActivityController@export');
        Route::get('create', 'ActivityController@getCreate');
        Route::post('store', 'ActivityController@store');
        Route::post('{id}/status-change', 'ActivityController@postStatusChange');
        Route::get('edit', 'ActivityController@edit');
        Route::get('{id}/join', 'ActivityController@activitJoin')->where('id', '[0-9]+');
        Route::post('{id}/publish', 'ActivityController@postPublish')->where('id', '[0-9]+');
        Route::post('{id}/pro', 'ActivityController@postPro')->where('id', '[0-9]+');
        Route::post('{id}/del', 'ActivityController@postDel')->where('id', '[0-9]+');

        Route::get('class', 'ActivityController@class');
        Route::post('class/del', 'ActivityController@classDel');
        Route::post('class/insert', 'ActivityController@classInsert');
    });

    Route::group(['prefix' => 'banner'], function () {
        Route::get('/', 'BannerController@index');
        Route::get('page-rows', 'BannerController@getPageRows');
        Route::get('create', 'BannerController@create');
        Route::post('store', 'BannerController@store');
        Route::get('edit', 'BannerController@edit');
        Route::post('del', 'BannerController@del');
        Route::post('change', 'BannerController@postChange');
    });

    Route::group(['prefix' => 'help'], function () {
        Route::get('/', 'HelpController@index');
        Route::get('page-rows', 'HelpController@getPageRows');
        Route::get('create', 'HelpController@getCreate');
        Route::post('del', 'HelpController@postDelete');
        Route::post('store', 'HelpController@store');
        Route::get('edit', 'HelpController@edit');
    });

    Route::group(['prefix' => 'feedback'], function () {
        Route::get('/', 'FeedbackController@index');
        Route::post('delete', 'FeedbackController@postDelete');
    });

    Route::group(['prefix' => 'energy'], function () {
        Route::get('/', 'EnergyComeController@index');
        Route::get('/page-rows', 'EnergyComeController@getPageRows');
    });

    Route::post('upload-img', 'UploadController@postUploadImg');
    Route::post('upload-base', 'UploadController@postUploadBase');
});

Route::group(['prefix' => 'api', 'namespace' => 'Api'], function () {
    Route::get('entrust/user-page-rows', 'EntrustController@getUserPageRows');
    Route::get('entrust/user-login-log', 'EntrustController@getUserLoginLog');
    Route::post('entrust/user-insert', 'EntrustController@postUserInsert');
    Route::post('entrust/user-update', 'EntrustController@postUserUpdate');
    Route::post('entrust/user-delete', 'EntrustController@postUserDelete');
    Route::post('entrust/user-import', 'EntrustController@postUserImport');
    Route::get('entrust/role-rows', 'EntrustController@getRoleRows');
    Route::get('entrust/role-perms-rows', 'EntrustController@getRolePermsRows');
    Route::post('entrust/role-insert', 'EntrustController@postRoleInsert');
    Route::post('entrust/role-update', 'EntrustController@postRoleUpdate');
    Route::post('entrust/role-delete', 'EntrustController@postRoleDelete');
    Route::post('entrust/perm-insert', 'EntrustController@postPermInsert');
    Route::post('entrust/perm-update', 'EntrustController@postPermUpdate');
    Route::post('entrust/perm-delete', 'EntrustController@postPermDelete');
    Route::get('entrust/member-rows', 'EntrustController@getMemberRows');
    Route::get('entrust/outer-member-rows', 'EntrustController@getOuterMemberRows');
    Route::get('entrust/member-info', 'EntrustController@getMemberInfo');
    Route::post('entrust/add-member', 'EntrustController@postAddMember');
    Route::post('entrust/remove-member', 'EntrustController@postRemoveMember');
    Route::post('entrust/grant-perm', 'EntrustController@postGrantPerm');
    Route::post('entrust/remove-perm', 'EntrustController@postRemovePerm');

    Route::get('newsclass/list', 'NewsclassController@getList');
    Route::get('newsclass/info', 'NewsclassController@getInfo');
    Route::post('newsclass/insert', 'NewsclassController@postInsert');
    Route::post('newsclass/update', 'NewsclassController@postUpdate');
    Route::post('newsclass/delete', 'NewsclassController@postDelete');
    Route::post('newsclass/upload-pic1', 'NewsclassController@postUploadPic1');
    Route::post('newsclass/remove-pic1', 'NewsclassController@postRemovePic1');
    Route::post('newsclass/add-column', 'NewsclassController@postAddColumn');
    Route::post('newsclass/edit-column', 'NewsclassController@postEditColumn');
    Route::post('newsclass/add-popedom', 'NewsclassController@postAddPopedom');
    Route::post('newsclass/remove-popedom', 'NewsclassController@postRemovePopedom');

    Route::get('newsinfo/page-list', 'NewsinfoController@getPageList');
    Route::get('newsinfo/info', 'NewsinfoController@getInfo');
    Route::post('newsinfo/insert', 'NewsinfoController@postInsert');
    Route::post('newsinfo/update', 'NewsinfoController@postUpdate');
    Route::post('newsinfo/upload-pic1', 'NewsinfoController@postUploadPic1');
    Route::post('newsinfo/remove-pic1', 'NewsinfoController@postRemovePic1');
    Route::post('newsinfo/upload-pic2', 'NewsinfoController@postUploadPic2');
    Route::post('newsinfo/remove-pic2', 'NewsinfoController@postRemovePic2');
    Route::get('newsinfo/pics-info', 'NewsinfoController@getPicsInfo');
    Route::post('newsinfo/pics-insert', 'NewsinfoController@postPicsInsert');
    Route::post('newsinfo/pics-update', 'NewsinfoController@postPicsUpdate');
    Route::post('newsinfo/pics-delete', 'NewsinfoController@postPicsDelete');
    Route::post('newsinfo/upload-file1', 'NewsinfoController@postUploadFile1');
    Route::post('newsinfo/remove-file1', 'NewsinfoController@postRemoveFile1');
    Route::post('newsinfo/move', 'NewsinfoController@postMove');
    Route::post('newsinfo/delete', 'NewsinfoController@postDelete');
});

Route::any('ueditor', 'UEditorController@index');
